#include<bits/stdc++.h>
using namespace std;
const int maxn = 1001;
int a[maxn][maxn];
bool vis[maxn][maxn];
int d[12][2] = {{-2 , 1} , {-2 , -1} , {-2 , 2} , {-2 , -2} , {-1 , 2} , {2 , -1} , {2 , 2} , {2 , -2} , {1 , 2} , {1 , -2} , {2 , 1} , {-1 , -2}};
struct node{
	int x;
	int y;
	int step;
}q[1000001];
void bfs(int xx , int yy){
	memset(vis , 0 , sizeof(vis));
	int head = 1 , tail = 1;
	q[tail].x = xx;
	q[tail].y = yy;
	q[tail].step = 0;
	tail++;
	vis[xx][yy] = 1;
	while(head < tail){
		int x0 = q[head].x;
		int y0 = q[head].y;
		int step = q[head].step;
		if(x0 == 1 && y0 == 1){
			cout << step << endl;
			return;
		}
		for(int i = 0 ; i < 12 ; i++){
			int nx = x0 + d[i][0];
			int ny = y0 + d[i][1];
			if(nx >= 1 && nx <= 100 && ny >= 1 && ny <= 100 && !vis[nx][ny]){
				vis[nx][ny] = 1;
				q[tail].x = nx;
				q[tail].y = ny;
				q[tail].step = step + 1;
				tail++;
			}
		}
		head++;
	}
}
int main(){
	int xa , xb , ya , yb;
	cin >> xa  >> ya >> xb >> yb;
	bfs(xa , ya);
	bfs(xb , yb);
	return 0;
}
